package lp.service;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by uu on 2017/6/9.
 */
@Service
public class lpService {
    @Autowired
    private AmqpTemplate amqpTemplate;
    public void sendMessage(){
            for(int i=0;i<10;i++){
                amqpTemplate.convertAndSend("lpExchange","lpQueue","消息"+i);
            }
    }

    /**
     * 接收rabbitMQ消息队列中发送的延时消息
     * @param input
     */
    public void getMessage(String input){
        System.out.println(input);
    }

}
